<agenttpl file="user_center_header" />
        <style type="text/css">
            .cuttitle{display:inline-block;;*display:inline;width:130px;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;cursor:pointer;}
            .search-results .table-content table tr th{vertical-align:middle;font-size:12px;}
            .search-results .table-content table tr td{vertical-align:middle;font-size:12px;}
        </style>
        <script src="/public/js/clipboard.min.js"></script>
    
    <section>
        <div class="user_center main">
            <div class="banner_1">
                <img src="__PUBLIC__img/1200-200+.jpg" alt=""/>
            </div>
            <div class="user_center_main page-content">
                <agenttpl file="share/side" />
                <div class="page-right my-game">
                    <div class="search-results">

                        <div class="results-header">
                            <span class="game-num">共找到<i>{$total_count}</i>个游戏</span>
                        </div>
                        <div class="table-content">
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tbody>
                                    <tr>
                                        <th width="82">游戏ID</th>
                                        <th width="150">游戏名称</th>
                                        <th width="154">添加时间</th>
                                        <th width="102" style="display: none;">下载地址</th>
                                        <th width="120">我的折扣</th>
                                        <th width="88">状态</th>
                                        <th width="250">操作</th>
                                    </tr>
                                <volist name="games" id="vo">
                                    <tr class="even">
                                        <td>{$vo.app_id}</td>
                                        <td class="click-copy">
                                            <span class="cuttitle" onclick="showGameInfo('', '{$vo.app_id}')">{$vo.gamename}</span>
                                        </td>
                                        <!--<td class="game-size">51.5M</td>-->
                                        <td><?php echo date("Y-m-d H:i:s",$vo['update_time']); ?></td>
                                        <td><span class="agent_rate"><?php echo round($vo['agent_rate'],2); ?></span> &nbsp;&nbsp; 
                                        </td>
                                        <td class="">
                                            <if condition="$vo.pack_updated eq 0">
                                                上架
                                            <else />
                                                <span style="color:red;" title="游戏包版本已更新，请重新下载">更新</span>
                                            </if>
                                        </td>
                                    <td>               
                                        <a href="javascript:;" class="btn subpack_btn btn-sm btn-default" data-agentgameid="{$vo.id}" >分包</a>
                                        &nbsp;&nbsp;
                                        
                                        <a href="javascript:;" class="btn btn-default btn-sm link_copy_btn" data-clipboard-text="{$vo.app_fp}" 
                                           data-link="{$vo.app_fp}">复制链接</a>
                                    </td>
                                    </tr>
                                </volist>
                                
                                <div style="display:none;width:300px;text-align:center;font-size:20px;padding:20px;" id="domessage">分包中，请稍等...</div>
                                <script src="/public/js/jquery.blockUI.min.js"></script>
                                <script src="/public/huoshu/clipboard.js"></script>
                                <script>
                                    $(document).ajaxStop($.unblockUI);
                                    
                                    function setrate2(e) {
                                        var r = $(e).siblings(".agent_rate").text();
                                        $(e).siblings(".agent_rate").html("<input class='agent_rate_input' name='agent_rate' type='text' value='" + r + "' />");
                                        $(".agent_rate_input").focus();
                                        $(e).text("提交");
                                        $(e).parent("td").append(" <a href='javascript:;' class='agent_rate_cancel_edit'>取消</a>");
                                        $(e).siblings(".agent_rate_cancel_edit").click(function () {
                                            $(e).siblings(".agent_rate").text(r);
                                            $(e).text("编辑");
                                            $(e).siblings(".agent_rate_cancel_edit").remove();
                                        });
                                    }

                                    function setrate(e) {
                                        var r = $(e).siblings(".agent_rate").text();
                                        var agent_game_id = $(e).attr("agent_game_id");
//                                        alert(agent_game_id);
//                                        return;
                                        var r_new = prompt("请输入新的折扣", r);
                                        if (r_new !== null && r_new !== "" && !isNaN(r_new)) {
                                            $.post("{:U('Agent/game/set_mem_rate')}", {"rate": r_new, "agent_game_id": agent_game_id}, function (data) {
                                                if (data.error === '1') {
                                                    yxalert(data.msg);
                                                } else {
                                                    location.reload();
                                                }
                                            });
                                        }
                                    }
                                    function download_app(url,ag_id) {
                                        $.post("{:U('Agent/Game/setDownVer')}",{"ag_id":ag_id});
                                        window.open(url);
                                        location.reload();
                                    }
                                    
                                    
                                    $(".subpack_btn").click(do_pack);
                                    function do_pack(){
                                        $.blockUI({ message: $('#domessage') });
                                        var id=$(this).attr("data-agentgameid");
                                        $.post("{:U('Agent/Game/pack')}",{"id":id},function(data){
                                            if(data.error==='0'){
                                                yxalert(data.msg);
                                            }else if(data.error==='1'){
                                                yxalert(data.msg);
                                            }
                                        });
                                    }
                                </script>
                                <style>
                                    .agent_rate_input{
                                        width:40px;
                                    }
                                </style>
                                </tbody>
                            </table>
                            <div class="page" style="">
                                <div class="paging">{$Page}</div>
                            </div>
                            <!-- 弹出层 -->
                            <div style="width: 1000px;height: 642px;background: #FFFFFF;display: none;position: absolute;z-index: 9999;" id="game-pop">
                                <div id="game-pop-header">
                                    <span>游戏详情</span><img src="__PUBLIC__img/pop-closed.png" onclick="closebox(' #game - pop ')">
                                </div>
                                <div class="container2">
                                    <div class="div_scroll">
                                        <div class="title">
                                            <ul>
                                                <li style="padding-left: 0;">我的游戏：<span id="pop-gamename"></span></li>
                                                <li>游戏版本：<span id="pop-version"></span></li>
                                                <li>游戏大小：<span id="pop-gamesize"></span></li>
                                                <li style="border-right: none;">游戏题材：<span id="pop-gametheme"></span></li>
                                            </ul>
                                        </div>
                                        <div class="game-introduction">
                                            <div class="game-introduction-title">
                                                <span>游戏简介</span>
                                            </div>
                                            <div class="game-introduction-content">
                                                <p id="pop-gamecontent"></p>
                                                <span class="up">收起</span>
                                            </div>
                                            <div class="game-screenshots">
                                                <span>游戏截图</span>
                                            </div>
                                            <div class="screenshots">
                                                <div class="hd">
                                                    <ul><li class="on">1</li><li>2</li></ul>
                                                </div>
                                                <div class="bd">
                                                    <a href="javascript:void(0)" class="prev prevStop"></a>
                                                    <a href="javascript:void(0)" class="next"></a>
                                                    <div class="tempWrap" style="overflow:hidden; position:relative; width:756px"><ul id="pop-gamepic" style="width: 1008px; left: 0px; position: relative; overflow: hidden; padding: 0px; margin: 0px;">
                                                            <li class="left" style="float: left; width: 242px;"><img src="./mygames_files/pic1.jpg"></li>
                                                            <li style="float: left; width: 242px;"><img src="./mygames_files/pic1.jpg"></li>
                                                            <li style="float: left; width: 242px;"><img src="./mygames_files/pic1.jpg"></li>
                                                            <li style="float: left; width: 242px;"><img src="./mygames_files/pic1.jpg"></li>
                                                        </ul></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    

<script src="__PUBLIC__js/autoPage.js"></script>
<script src="__PUBLIC__My97DatePicker/WdatePicker.js"></script>
<script src="__PUBLIC__js/mygames.js"></script>
<script>
    function succHeader() {
        $("nav .main_nav li").eq(1).addClass("active").siblings().removeClass("active");
    }
    succHeader();

    function delete_apply(id) {
        var con = confirm("真的要撤销此游戏的申请吗？");
        if (!con) {
            return;
        }
        sendData("{:U('Agent/Game/cancelApply')}", {"id": id}, function (data) {
            if (data.error === '0') {
                location.reload();
            } else {
                alert('取消申请失败');
            }
        });
    }

    $(".i-one .input-one").click(function () {
        $(".ul-one").css("z-Index", "9999");
        $(".ul-one").toggle();
        $(".ul-one li").click(function () {
            var t = $(this).text();
            var v = $(this).attr("data-val");
            $(".input-one").text(t);
            $("#state").val(v);
            $(".ul-one").hide();
        });
    });

    $(".i-two .input-two").click(function () {
        $(".ul-two").css("z-Index", "9999");
        $(".ul-two").toggle();
        $(".ul-two li").click(function () {
            var t = $(this).text();
            var v = $(this).attr("data-val");
            $(".input-two").text(t);
            $("#flag").val(v);
            $(".ul-two").hide();
        });
    });

    $(".search-btn").click(function () {
        $("#queryForm").submit();
    });
</script>


<agenttpl file="user_center_footer" />